var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (!cm.isQuestActive(3314)) {
                cm.dispose();
                return
            } else {
                cm.sendNormalTalk("书桌上放着几个小小的秘药。拿一个给他吧……", 0, 2111015, false, false);
                if (!cm.haveItem(2438888)) {
                    cm.gainItem(2438888, 1)
                }
            }
            cm.dispose()
        }
    }
};